package com.example.teamtribe.database;

import org.litepal.crud.DataSupport;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

public class Estimate extends DataSupport implements Parcelable {

    private int id;
    private int teamId;
    private String name;
    private List<String> question;
    private List<Integer> grade;
    private String suggest;

    public Estimate() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getTeamId() {
        return teamId;
    }

    public void setTeamId(int teamId) {
        this.teamId = teamId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<String> getQuestion() {
        return question;
    }

    public void setQuestion(List<String> question) {
        this.question = question;
    }

    public List<Integer> getGrade() {
        return grade;
    }

    public void setGrade(List<Integer> grade) {
        this.grade = grade;
    }

    public String getSuggest() {
        return suggest;
    }

    public void setSuggest(String suggest) {
        this.suggest = suggest;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeInt(this.teamId);
        dest.writeString(this.name);
        dest.writeStringList(this.question);
        dest.writeList(this.grade);
        dest.writeString(this.suggest);
    }

    protected Estimate(Parcel in) {
        this.id = in.readInt();
        this.teamId = in.readInt();
        this.name = in.readString();
        this.question = in.createStringArrayList();
        this.grade = new ArrayList<Integer>();
        in.readList(this.grade, Integer.class.getClassLoader());
        this.suggest = in.readString();
    }

    public static final Creator<Estimate> CREATOR = new Creator<Estimate>() {
        @Override
        public Estimate createFromParcel(Parcel source) {
            return new Estimate(source);
        }

        @Override
        public Estimate[] newArray(int size) {
            return new Estimate[size];
        }
    };
}
